﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <!-- Documenting T:NAnt.Contrib.Tasks.CodeStatsTask-->
  <head>
    <meta http-equiv="Content-Language" content="en-ca" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="../style.css" />
    <title>&lt;codestats&gt; Task</title>
  </head>
  <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
      <tr>
        <td class="NavBar-Cell">
          <a href="">
            <b>NAntContrib</b>
          </a>
          <img alt="-&gt;" src="../images/arrow.gif" />
          <a href="../index.html">Help</a>
          <img alt="-&gt;" src="../images/arrow.gif" />
          <a href="../tasks/index.html">Task Reference</a>
          <img alt="-&gt;" src="../images/arrow.gif" /> &lt;codestats&gt;</td>
        <td class="NavBar-Cell" align="right">
                        v0.85</td>
      </tr>
    </table>
    <h1>&lt;codestats&gt;</h1>
    <p> Generates statistics from source code. </p> Scans files in a fileset counting lines. <h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top">append</td><td style="text-align: center;">bool</td><td> Specifies whether the results should be appended to the output file. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">buildname</td><td style="text-align: center;">string</td><td> An identifier to be able to track which build last updated the code stats file. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">output</td><td style="text-align: center;">file</td><td> The name of the file to save the output to (in XML). </td><td style="text-align: center;">False</td></tr><tr><td valign="top">summarize</td><td style="text-align: center;">bool</td><td> If you only want to show summary stats for the whole fileset </td><td style="text-align: center;">False</td></tr><tr><td valign="top">failonerror</td><td style="text-align: center;">bool</td><td> Determines if task failure stops the build, or is just reported. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> If <b>true</b> then the task will be executed; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> Opposite of <code>if</code>. If <b>false</b> then the task will be executed; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">verbose</td><td style="text-align: center;">bool</td><td> Determines whether the task should report detailed build log messages. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div><h3>Nested Elements:</h3><!--Collection--><h4><a id="counts"></a>
            &lt;counts&gt;
        </h4><div class="nested-element"> Set of line counters to enable. <h5>&lt;count&gt;</h5><div class="nested-element"><p></p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">label</td><td style="text-align: center;">string</td><td> The label to apply to the results. </td><td style="text-align: center;">True</td></tr></table></div><h3>Nested Elements:</h3><!--Element--><h4><a id="fileset"></a>
                    &lt;<a href="http://nant.sourceforge.net/help/types/fileset.html">fileset</a>&gt;
                </h4><div class="nested-element"> The set of files to work on. <p /></div><h4><a id="fileset"></a>
                    &lt;/<a href="http://nant.sourceforge.net/help/types/fileset.html">fileset</a>&gt;
                </h4></div><h5>&lt;/count&gt;</h5></div><h4>&lt;/counts&gt;</h4><h3>Examples</h3><ul class="examples"><li><p> Generate statistics for a set of C# and VB.NET sources, applying different labels for both. </p><pre class="code">
&lt;codestats output="test.xml" append="true" buildname="MyBuildName"&gt;
    &lt;counts&gt;
        &lt;count label="C#"&gt;
            &lt;fileset&gt;
                &lt;include name="**/*.cs" /&gt;
            &lt;/fileset&gt;
        &lt;/count&gt;
        &lt;count label="VB"&gt;
            &lt;fileset&gt;
                &lt;include name="**\*.vb" /&gt;
            &lt;/fileset&gt;
        &lt;/count&gt;
    &lt;/counts&gt;
&lt;/codestats&gt;
    </pre></li><li><p> Generate statistics for all C# sources and only output a summary to the log. </p><pre class="code">
&lt;codestats output="test.xml" verbose="true" summarize="true"&gt;
    &lt;counts&gt;
        &lt;count label="C#"&gt;
            &lt;fileset&gt;
                &lt;include name="**\*.cs" /&gt;
            &lt;/fileset&gt;
        &lt;/count&gt;
    &lt;/counts&gt;
&lt;/codestats&gt;
    </pre></li></ul><h3>Requirements</h3><div style="margin-left: 20px;"><b>Assembly:</b> NAnt.Contrib.Tasks (0.85.2479.0)
            </div></body>
</html>